using System.Collections.Generic;

namespace MVP.DTO
{
    public class LookupCollection : ILookupCollection
    {
        private IList<ILookupDTO> items;

        public LookupCollection(IEnumerable<ILookupDTO> items)
        {
            this.items = new List<ILookupDTO>(items);
        }

        public int Count
        {
            get { return items.Count; }
        }

        public void BindTo(ILookupList list)
        {
            list.Clear();
            foreach (ILookupDTO dto in items)
            {
                list.Add(dto);
            }
        }
    }
}